import 'package:cbec_app/pages/home/view/decoration_renderer.dart';
import 'package:flutter/material.dart';
import 'package:get/get_state_manager/src/simple/get_state.dart';
import 'package:get/get_state_manager/src/simple/get_view.dart';
import '../../../components/base/base_nav_bar.dart';
import '../../../components/base/base_page.dart';
import '../../../utils/Tools.dart';
import '../controller/secondary_micro_ctr.dart';

///微页面
class SecondaryMicroPage extends GetView<SecondaryMicroCtr> {
  const SecondaryMicroPage({super.key});

  @override
  Widget build(context) {
    return GetBuilder<SecondaryMicroCtr>(
      builder: (controller) {
        return BasePage(
          enablePullDown: true,
          enablePullUp: false,
          refreshController: controller.baseRefreshCtr,
          onPageRefresh: controller.onPageRefresh,
          onPageLoading: controller.onPageLoading,
          iconType: IconType.back,
          title: controller.titleName,
          bodyColor: Tools.fromHex(controller.bgColor),
          isShowShare: true,
          shareCallBack: () {
            controller.sharePage();
          },
          isImmersionNav: controller.isImmersionNav,
          // navType: NavType.decoration,
          decorationInfo: controller.navigation?.toJson(),
          children: const [
            DecorationRenderer(isSecondaryMicro: true),
          ],
        );
      },
    );
  }
}
